package cn.net.withub.dataCollector.web.job;

import cn.net.withub.dataCollector.web.service.CollectorService;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * Created by yuanjie on 2018/5/15.
 */
@Component(value = "collectorJob")
public class CollectorJob {

    @Resource
    private CollectorService collectorService;

    public Logger log = Logger.getLogger(this.getClass());

    /**
     * 执行抓取任务
     * */
    public void executeCollector() throws Exception {
        try {
            collectorService.executeCollector();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
